<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/public/func.php');
$config=include_once($_SERVER['DOCUMENT_ROOT'].'/public/config.php');
$_POST['time']=time();
$res = add($config,'category',$_POST);

if($res){
	echo '<script>alert("添加成功！");window.location.href="/admin/category/index.php"</script>';
}else{
	echo '<script>alert("添加失败！");window.location.href="/admin/category/add.php"</script>';
}

mysql_close();